<template>
  <div class="IconTem-container flex-row-y-center" v-if="url">
    <template v-for="(item, index) in url.split(',')">
      <template v-if="showIndex.includes(Number(index))">
        <img v-if="item.includes('http')" :src="item" alt="" class="img" />
        <component v-else style="font-size: 18px" :is="item"></component>
      </template>
    </template>
  </div>
</template>

<script lang="ts" setup>
const props = defineProps({
  url: {
    type: String,
    default: ""
  },
  showIndex: {
    type: Array,
    default: [0, 1]
  }
});
</script>

<style lang="less" scoped>
.IconTem-container {
  line-height: 1;
  .img {
    width: 20px;
    height: 20px;
  }
}
</style>
